package org.liuwei.concurent03.pipelineCalculation;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;


public class Plus implements Runnable {
    public static BlockingQueue<Msg> bq = new LinkedBlockingDeque<Msg>();

    public void run() {
     while (true){
         try {
             Msg msg=bq.take();
             msg.j=msg.i+msg.j;
             Multiply.bq.add(msg);
         }catch (InterruptedException e){
             e.printStackTrace();
         }
     }
    }
}